Kanzi provides low and high-level access to input:
Kanzi provides input manipulators to enable gesture recognition for objects in your Kanzi project. You can assign the manipulators through the API.
KzuInputManipulator
is the base class for manipulators, and functions such as kzuClickManipulatorCreate
and kzuPanManipulatorCreate
create input manipulators responsible for the corresponding gesture recognition.
When you create an input manipulator, to recognize the gesture, attach it to the object with kzuObjectNodeAttachInputManipulator
. This attaches all the object's children too.
Attached manipulator generates messages in response to user actions. Each manipulator uses messages to report different events during gesture recognition, such as KZU_MESSAGE_PAN_STARTED
, KZU_MESSAGE_PAN_MOVED
, KZU_MESSAGE_PAN_FINISHED
for the pan manipulator and so on.
The system uses hit testing to determine the objects that receive input. In practice, hit testing projects a ray from the camera towards the 3D scene based on the input event’s screen coordinates. The first object whose bounding box is intersected and whose Hit Testable property is enabled, consumes the event and generates set actions, such as sending a click message.
By default hit testing is disabled. To enable hit testing, add to the object the Hit Testable property, and enable it.
You can also add to an object the Hit Testable Container property which tests the ray against the back face of the layout volume.